package anatex.kea.stemmers;

import java.util.HashMap;

import anatex.domain.CustomLocale;

public class StemmerFactory {
	
	protected static HashMap<String, Stemmer> stemmers = new HashMap<String, Stemmer>();
	
	public static Stemmer getStemmer(CustomLocale locale) {
		String loc = locale.toString();
		Stemmer stem = null;
		
		if (! stemmers.containsKey(loc)) {
			if (loc.equals(new String("bg, BG"))) {
				stemmers.put(loc, new BulgarianStemmer());
			} else if (loc.equals(new String("en, US"))) {
				stemmers.put(loc, new IteratedLovinsStemmer());
			}
		}
		
		return stemmers.get(loc);
	}
	
}
